<!-- 统一配置 -->
<template>
  <div>
    <commonConfigForm
      ref="commonView"
      class="commonView"
      :option="configOption"
      :defaultValue="configForm"
    >
    </commonConfigForm>
  </div>
</template>
<script>
export default {
  name: 'commonView',

  data() {
    return {
      key: 0,
      configOption: {},
      reqParams: {},
      configForm: {},
      originalObject: this.$route.query,
    };
  },
  watch: {
    originalObject: {
      handler(val) {
        if (val) {
          this.fetchParams();
          this.queryStrategyUi();
        }
      },
      deep: true, // 深度观察监听 设置为 true
      immediate: true, // 第一次初始化渲染就可以监听到
    }
  },
  created() {

  },
  mounted() {

  },
  methods: {
    //解析参数
    fetchParams() {
      const {isVue, token, ...newObject} = this.originalObject;
      this.reqParams = newObject;
    },

    // 读取页面
    queryStrategyUi() {
      if (!this.reqParams.op) {
        this.$message.warning("当前没有配置界面跳转操作");
        return;
      }
      this.$myAxios.post("/uavMesh/operation/getOperationUiContentByProcessKey", {processKey: this.reqParams.op}).then(res => {
        let uiContent = res.data.data.design.uiContent;
        uiContent.pageName = this.reqParams.op;
        this.$set(this, 'configOption', uiContent)
      })
    },
  },
};




</script>
<style lang="less" scoped>
.commonView {
  width: 100%;
  height: 100%;
  position: relative;
}
</style>
